www.gusucode.com > 24Beta 虚拟主机版 1.0.0 Beta源码程序 > 24Beta 虚拟主机版 1.0.0 Beta源码程序/24Beta-1.0.0-vhost/protected/models/CommentMark.php

    <?php

class CommentMark extends CActiveRecord
{
	/**
	 * The followings are the available columns in table 'CommentMark':
	 * @var integer $id
	 * @var integer $comment_id
	 * @var integer $mark
	 * @var string $mark_user
	 * @var integer $mark_time
	 * @var string $mark_ip
	 */

	/**
	 * Returns the static model of the specified AR class.
	 * @return CActiveRecord the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'CommentMark';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		return array(
			array('mark_user','length','max'=>30),
			array('mark_ip','length','max'=>15),
			array('comment_id, mark', 'required'),
			array('comment_id, mark, mark_time', 'numerical', 'integerOnly'=>true),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'Id',
			'comment_id' => 'Comment',
			'mark' => 'Mark',
			'mark_user' => 'Mark User',
			'mark_time' => 'Mark Time',
			'mark_ip' => 'Mark Ip',
		);
	}
}